using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._TopographicProductionTools._DataManagement._Generalization
{
    /// <summary>
    /// <para>Fill Gaps</para>
    /// <para>Fills gaps between polygon features that participate in a topology where the coincident boundaries are evident.</para>
    /// <para>填充参与拓扑的面要素之间的间隙，其中重合边界很明显。</para>
    /// </summary>    
    [DisplayName("Fill Gaps")]
    public class FillGaps : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public FillGaps()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_features">
        /// <para>Input Features</para>
        /// <para>A list of input polygon feature classes or layers to be analyzed for gaps.</para>
        /// <para>要分析间隙的输入面要素类或图层的列表。</para>
        /// </param>
        /// <param name="_max_gap_area">
        /// <para>Maximum Gap Area</para>
        /// <para>The maximum area that can be considered a gap. Areas larger than this threshold are not filled.</para>
        /// <para>可以被视为间隙的最大面积。大于此阈值的区域不会被填充。</para>
        /// </param>
        public FillGaps(List<object> _input_features, object _max_gap_area)
        {
            this._input_features = _input_features;
            this._max_gap_area = _max_gap_area;
        }
        public override string ToolboxName => "Topographic Production Tools";

        public override string ToolName => "Fill Gaps";

        public override string CallName => "topographic.FillGaps";

        public override List<string> AcceptEnvironments => ["scratchWorkspace"];

        public override object[] ParameterInfo => [_input_features, _max_gap_area, _fill_option.GetGPValue(), _fill_unenclosed_gaps.GetGPValue(), _max_gap_distance, _updated_features];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>A list of input polygon feature classes or layers to be analyzed for gaps.</para>
        /// <para>要分析间隙的输入面要素类或图层的列表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _input_features { get; set; }


        /// <summary>
        /// <para>Maximum Gap Area</para>
        /// <para>The maximum area that can be considered a gap. Areas larger than this threshold are not filled.</para>
        /// <para>可以被视为间隙的最大面积。大于此阈值的区域不会被填充。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Gap Area")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _max_gap_area { get; set; }


        /// <summary>
        /// <para>Fill Option</para>
        /// <para><xdoc>
        ///   <para>Specifies how enclosed and unenclosed gaps are filled.</para>
        ///   <bulletList>
        ///     <bullet_item>Fill By Length—Gaps are filled by adding a gap's geometry to the polygon with the longest shared edge. This is the default.</bullet_item><para/>
        ///     <bullet_item>Fill By Order—Gaps are filled sequentially according to the order of the input polygon features list.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定如何填充封闭间隙和未封闭间隙。</para>
        ///   <bulletList>
        ///     <bullet_item>按长度填充 - 通过将间隙的几何添加到具有最长共享边的面来填充间隙。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>按顺序填充 - 根据输入面要素列表的顺序按顺序填充间隙。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Fill Option")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _fill_option_value _fill_option { get; set; } = _fill_option_value._FILL_BY_LENGTH;

        public enum _fill_option_value
        {
            /// <summary>
            /// <para>Fill By Length</para>
            /// <para>Fill By Length—Gaps are filled by adding a gap's geometry to the polygon with the longest shared edge. This is the default.</para>
            /// <para>按长度填充 - 通过将间隙的几何添加到具有最长共享边的面来填充间隙。这是默认设置。</para>
            /// </summary>
            [Description("Fill By Length")]
            [GPEnumValue("FILL_BY_LENGTH")]
            _FILL_BY_LENGTH,

            /// <summary>
            /// <para>Fill By Order</para>
            /// <para>Fill By Order—Gaps are filled sequentially according to the order of the input polygon features list.</para>
            /// <para>按顺序填充 - 根据输入面要素列表的顺序按顺序填充间隙。</para>
            /// </summary>
            [Description("Fill By Order")]
            [GPEnumValue("FILL_BY_ORDER")]
            _FILL_BY_ORDER,

        }

        /// <summary>
        /// <para>Fill Unenclosed Gaps</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the tool fills unenclosed gaps.</para>
        ///   <bulletList>
        ///     <bullet_item>Unchecked—Only enclosed gaps are filled. Unenclosed gaps are skipped. This is the default.</bullet_item><para/>
        ///     <bullet_item>Checked—Both enclosed and unenclosed gaps are filled.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定工具是否填充未封闭的间隙。</para>
        ///   <bulletList>
        ///     <bullet_item>未选中 - 仅填充封闭的间隙。跳过未封闭的间隙。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>选中 - 填充封闭和未封闭间隙。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Fill Unenclosed Gaps")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _fill_unenclosed_gaps_value _fill_unenclosed_gaps { get; set; } = _fill_unenclosed_gaps_value._false;

        public enum _fill_unenclosed_gaps_value
        {
            /// <summary>
            /// <para>SKIP_UNENCLOSED_GAPS</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SKIP_UNENCLOSED_GAPS")]
            [GPEnumValue("false")]
            _false,

            /// <summary>
            /// <para>FILL_ALL</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FILL_ALL")]
            [GPEnumValue("true")]
            _true,

        }

        /// <summary>
        /// <para>Maximum Gap Distance</para>
        /// <para>The maximum distance between features in which a gap can be filled. This parameter is used only when the Fill Unenclosed Gaps parameter is checked.</para>
        /// <para>可填充间隙的要素之间的最大距离。仅当选中“填充未封闭的间隙”参数时，才使用此参数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum Gap Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _max_gap_distance { get; set; } = null;


        /// <summary>
        /// <para>Updated Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public List<object> _updated_features { get; set; }


        public FillGaps SetEnv(object scratchWorkspace = null)
        {
            base.SetEnv(scratchWorkspace: scratchWorkspace);
            return this;
        }

    }

}